Skip to content

fix(vscode): clear completed session indicator when its tab is focused - #13703

Closed
ehudc wants to merge 3 commits into
Kilo-Org:mainfrom
ehudc:clear-completed-indicator-on-focus
Closed

ehudc wants to merge 3 commits into
Kilo-Org:mainfrom
ehudc:clear-completed-indicator-on-focus

Conversation

@ehudc

@ehudc ehudc commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #13702

Context

Follow-up to #13504, which added session-activity icons to tabs. A session's completed () indicator persists on its tab even after you open that session to review it. The check only clears on a new turn, revert, resume, submit, or delete — so when a background session finishes, you see the from another tab, click in to review, and the stays. That makes it hard to tell, across many tabs, which completed sessions you've already looked at.

Implementation

The activity state for every surface (sidebar tabs, native editor tabs, Agent Manager tabs, worktree cards) is derived from one shared map computed from closeMap (outcomes), statuses, blocked, and submitting — notably not from which tab is focused. The completed outcome is only dropped by clearClose(id), whose callers are new turn / revert / resume / submit / delete.

This adds one more trigger: when currentSessionID changes to a session that is already in the done state, clear its close outcome. It's keyed on the focus transition via on(currentSessionID, ...), deliberately not a continuous effect — so a session that completes while it's already the focused tab still shows its check (it only clears once you navigate away and back). Because all surfaces read the same derived map, clearing in this one place updates every surface.

Scope is intentionally narrow: only done is acknowledged on focus. waiting (needs input/permission) and error are never cleared by focus, since those are unresolved states that must persist until the user actually acts.

Screenshots / Video

clear-done-kilo-tab.mov

How to Test

Manual/local verification

  • Ran the affected regression, extended to cover this behavior: bun test tests/unit/session-provider-activity.test.ts — passes. Added assertions cover (a) a session that completes while another tab is focused shows done, then clears when you switch to it, and (b) the guardrail: switching to a tab in the waiting state does not clear it.
  • bun run check-types:webview — clean.
  • eslint on the two changed files — clean.
  • Built the extension and verified in an isolated VS Code dev host: with two sessions, let one finish while focused on the other; the shows on the background tab and clears on clicking into it; a needs-input tab does not clear on click.

Reviewer test steps

  1. Open two Kilo sessions (sidebar tabs or Agent Manager).
  2. Start a turn in session A, switch to session B.
  3. When A completes, confirm B's tab is unaffected and A's tab shows the green .
  4. Click A. Confirm the clears now that A is focused.
  5. Trigger a permission/question in a third session while on another tab, then click into it without answering — confirm the amber persists (only done clears on focus).

The completed (done) activity check persisted on a session tab even after
the user opened that session to review it. It only cleared on a new turn,
revert, resume, submit, or delete. Clear it on the focus transition instead:
when currentSessionID changes to a session already in the done state, drop
its close outcome so every surface (sidebar tabs, native editor tabs, Agent
Manager tabs, worktree cards) that derives from the shared activity map
updates. A session that completes while already focused keeps its check;
waiting and error states are never cleared by focus.
@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/clear-completed-indicator-on-focus.md
  • packages/kilo-vscode/tests/fixtures/session-provider-activity.tsx
  • packages/kilo-vscode/webview-ui/src/context/session.tsx

Reviewed by grok-4.6 · Input: 148.1K · Output: 16.4K · Cached: 653.6K

Review guidance: REVIEW.md from base branch main

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Thanks @ehudc, this makes sense. Opening a finished result is a good point to clear its notification.

I prepared a follow-up locally to make this consistent for worktrees, subagent tabs, returning from Review, and sidebar/editor focus. It shares acknowledgement across views without clearing busy, waiting, or error states, and keeps the actual turn outcome intact. Regression tests, lint, typechecks, and the build pass, and I verified the flows in isolated VS Code.

Can you enable Allow edits from maintainers so I can push the follow-up and finish the checks? It is currently disabled, so these additions are not on this PR yet.

Worktree screenshots: acknowledge only the session that was opened

Before: Checks has been opened, but Implementation is still unread, so the worktree keeps its completion badge.

Worktree completion badge remains while Implementation is unread

After opening Implementation: both its badge and the worktree badge clear. The completed result stays visible.

Opening Implementation clears the session and worktree completion badges
Subagent screenshots: acknowledge completion without changing the running sibling

Before and after opening Analysis. Its completion badge clears; Review remains busy. These screenshots use an isolated test provider.

Analysis has an unread completion while Review remains busy Opening Analysis clears its completion badge while Review remains busy

@marius-kilocode

Copy link
Copy Markdown
Collaborator

I opened #13731 to supersede this PR with the original behavior plus consistent worktree, subagent, sidebar, and editor handling. Thanks for the original fix, clearing the notification when opening the result makes sense.

For future PRs, I recommend enabling Allow edits from maintainers so we can add follow-up fixes directly to your branch instead of opening a replacement.

@ehudc

ehudc commented Sep 3, 2026

Copy link
Copy Markdown
Author

@marius-kilocode Thanks, didn't know about that setting for edits, and I'll close this PR with your other branch superseding it.

@ehudc ehudc closed this Sep 3, 2026
@ehudc
ehudc deleted the clear-completed-indicator-on-focus branch September 3, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: VSCode, clear the completed (✓) session indicator when you focus/open that tab

2 participants